/**
 * 工单生产计划 api 封装
 *
 * @Author:    lmabbe
 * @Date:      2025-06-26 19:38:05
 * @Copyright  lmabbe
 */
import { getRequest, postRequest } from '/@/lib/axios';

export const productionPlanApi = {
  /**
   * 分页查询  @author  lmabbe
   */
  queryPage: (param) => {
    return postRequest('/productionPlan/queryPage', param);
  },

  /**
   * 增加  @author  lmabbe
   */
  add: (param) => {
    return postRequest('/productionPlan/add', param);
  },

  /**
   * 修改  @author  lmabbe
   */
  update: (param) => {
    return postRequest('/productionPlan/update', param);
  },

  /**
   * 删除  @author  lmabbe
   */
  delete: (id) => {
    return getRequest(`/productionPlan/delete/${id}`);
  },

  /**
   * 批量删除  @author  lmabbe
   */
  batchDelete: (idList) => {
    return postRequest('/productionPlan/batchDelete', idList);
  },

  audit: (planId, isAudit) => {
    return postRequest(`productionPlan/${planId}/audit/${isAudit}`);
  },

  activate: (planId) => {
    return postRequest(`productionPlan/activate/${planId}`);
  },
  pauseProduce: (planId) => {
    return postRequest(`productionPlan/pauseProduce/${planId}`);
  },

  reactivate: (planId) => {
    return postRequest(`productionPlan/reactivate/${planId}`);
  },
  forcedShutdown: (planId, forcedShutdownReason) => {
    return getRequest(`productionPlan/forcedShutdown/${planId}?forcedShutdownReason=${forcedShutdownReason}`);
  },
};
